public class Typepromotion {
    public static void main(String[] args) {
        //类型提升
        //1，
        int a = 10;
        long b = 20;
//    int c = a + b;
        long d = a + b;

        //2.
        byte a1 = 10;
        byte b1 = 20;
//        byte c1 = a1 + b1;
//        System.out.println(c1);

        //四。字符串类型；
        String s1 = "hello1";
        String s2 = "world";
        System.out.println(s1);
        System.out.println(s2);
        System.out.println(s1+s2);


        //int 转String；
        int num = 10;
        //方法1
        String str1 = num + "";
        //方法2
        String str2 = String.valueOf(num);

        System.out.println(num);

        //int 转 String
        int num2 = 20;
        String str3 = num2 + "";
        String str4 = String.valueOf(num2);

        //String 转 int ;
        String str5 = "1001";
        int num3 = Integer.parseInt(str5);
        System.out.println(str5);


    }





}
